<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="UTF-8">
  <title>人员管理-v1</title>
  <link rel="stylesheet" href="../../lib/bootstrap/3.3.5/css/bootstrap.min.css"/>
  <link href="../../lib/bootstrap/3.3.5/css/bootstrap.css" type="text/css" rel="stylesheet"/>
</head>
<body>

<div id="res" class="container-fluid">

  <div class="row-fluid">
    <div class="col-sm-12">
      <h3 class="page-header text-center">
        人员管理
        <small>{{modeTitle}} (Task Viewer)</small>
      </h3>
    </div>
  </div>


  <div class="row">
    <div class="col-sm-12">
      <br/>
    </div>
  </div>

  <div class="row">
    <div class="collapse col-sm-12" id="advancedsearch">
      <div class="well">
        <div class="row">
          <!-- <form class="form-horizontal contract-form"> -->
          <div class="form-group">
            <label class="col-sm-1 control-label">Begin Time</label>

            <div class="col-sm-5">
              <input id="begtime" name="begtime" type="text" v-model="begtime" value="2015-01-01" class="form-control"
                     required/>
            </div>
            <label class="col-sm-1 control-label">End Time</label>

            <div class="col-sm-5">
              <input id="endtime" name="endtime" type="text" v-model="endtime" value="2016-02-01"
                     class="form-control" required/>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-1 control-label">User Id</label>

            <div class="col-sm-5">
              <input id="user" name="user" type="text" v-model="user" value="" class="form-control" required/>
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-offset-9 col-sm-1">
              <button class="btn btn-outline btn-block btn-warning" type="reset">清除</button>
            </div>
            <div class="col-sm-2">
              <button id='submitbutton' class="btn btn-outline btn-block btn-success save"
                      v-on:click="advancedsearch($event)">提交
              </button>
            </div>
          </div>
          <!-- </form> -->
        </div>
      </div>
    </div>
    <!-- advancedsearch -->
  </div>

  <div class="row">
    <div class="row">
      <div class="collapse col-sm-12" id="details">
        <div class="well">
          <div class="row">
            <!-- <form class="form-horizontal contract-form"> -->
            <table class="table table-bordered table-condensed table-striped">
              <thead>
              <tr>
                <th>人员id</th>
                <th>json</th>
                <th>姓名</th>
                <th>性别</th>
                <th>出生日</th>
                <th>联系电话</th>
                <th>通信地址</th>
                <th>邮箱</th>
              </tr>
              </thead>
              <tbody>
              <td>{{items2.id}}</td>
              <td>{{items2.json}}</td>
              <td>{{items2.name}}</td>
              <td>{{items2.sex}}</td>
              <td>{{items2.birth}}</td>
              <td>{{items2.tel}}</td>
              <td>{{items2.address}}</td>
              <td>{{items2.email}}</td>
              </tbody>
            </table>
            <!-- </form> -->
          </div>
        </div>
      </div>
      <!-- details -->
    </div>
  </div>

  <div id="objectlist" v-show="mode=='modeList'">
    <div class="row">


      <itemsearch :item="curitem" :on-remove="onRemove" :on-back="onBack"
                  :set-mode="setMode"></itemsearch>
      <itemlist :mode="mode" :item="curitem" :items="items" :on-edit="onEdit" :on-remove="onRemove"
                :on-back="backToParent"
                :on-change="onChange"></itemlist>
    </div>
  </div>
  <!--/modeAddNew-->
  <div id="objectadd" v-show="mode=='modeAddNew'">
    <div class="row">
      <itemeditor :mode="mode" :item="curitem" :on-submit="onSave" :on-cancel="onCancel"></itemeditor>
    </div>
  </div>
  <!--/modeAddNew-->

  <div id="objecteditor" v-show="mode=='modeEdit'">
    <div class="row">
      <itemeditor :mode="mode" :item="curitem" :on-submit="onSave" :on-cancel="onCancel"></itemeditor>
    </div>
  </div>
  <!--/modeEdit-->

</div>
<!--/res-->

<template id="itemeditor-tpl">
  <div class="col-sm-12">
    <!--form begin-->
    <div class="form-horizontal">

      <div class="site-bgcolor">

        <div class="form-group">
          <label for="memberid" class="col-sm-2 control-label">id</label>

          <div class="col-sm-4">
            <input class="form-control" id="memberid" name="memberid" placeholder="id" readonly v-model="item.id">
          </div>
        </div>
        <div class="form-group">
          <label for="name" class="col-sm-2 control-label">name</label>

          <div class="col-sm-4">
            <input class="form-control" id="name" name="name" placeholder="name" v-model="item.name">
          </div>
        </div>
        <div class="form-group">
          <label for="birth" class="col-sm-2 control-label">birth</label>

          <div class="col-sm-4">
            <input class="form-control" id="birth" name="birth" placeholder="birth" v-model="item.birth">
          </div>
        </div>
        <div class="form-group">
          <label for="sex" class="col-sm-2 control-label">sex</label>

          <div class="col-sm-4">
            <input class="form-control" id="sex" name="sex" placeholder="sex" v-model="item.sex">
          </div>
        </div>
        <div class="form-group">
          <label for="tel" class="col-sm-2 control-label">tel</label>

          <div class="col-sm-4">
            <input class="form-control" id="tel" name="tel" placeholder="tel" v-model="item.tel">
          </div>
        </div>

        <div class="form-group">
          <label for="email" class="col-sm-2 control-label">email</label>

          <div class="col-sm-4">
            <input class="form-control" id="email" name="email" placeholder="email" v-model="item.email"/>
          </div>
        </div>
        <div class="form-group">
          <label for="address" class="col-sm-2 control-label">address</label>

          <div class="col-sm-4">
            <input class="form-control" id="address" name="address" placeholder="address" v-model="item.address"/>
          </div>
        </div>

        <div class="form-group" align="right">
          <div class="col-sm-offset-2 col-sm-10">
            <button class="btn btn-default" v-on:click="onCancelClick(item,$event)">取消</button>
            <button class="btn btn-default" v-on:click="onSubmitClick(item,$event)">保存</button>
          </div>
        </div>

        <hr/>
      </div>

    </div>
    <!-- </form> -->
  </div>
</template>

<template id="itemlist-tpl" class="container-fluid">
  <div class="table-responsive col-sm-12">
    <ul class="media-list row contacts-container"></ul>
    <table class="table table-bordered table-condensed table-striped">

      <br/>
      <thead>
      <tr  class="info">
        <th></th>
        <th>人员id</th>
        <th>姓名</th>
        <th>性别</th>
        <th>出生日</th>
        <th>联系电话</th>
        <th>邮箱</th>
        <th>oper</th>
      </tr>
      </thead>
      <tbody>
      <tr v-for="item in items">
        <td><input type="checkbox" v-model="item.selected"></td>
        <td><a data-toggle="collapse" href="#details"
               aria-expanded="false"
               aria-controls="details" v-on:click="onDetails(item)">{{item.id}}</a>
        </td>
        <td><a data-toggle="collapse" href="#details"
               aria-expanded="false"
               aria-controls="details" v-on:click="onDetails(item)">{{item.name}}</a>
        </td>
        <td>{{item.sex}}</td>
        <td>{{item.birth}}</td>
        <td>{{item.tel}}</td>
        <td>{{item.email}}</td>
        <td>
          <a href="#" v-on:click="onEdit(item,'modeEdit')">编辑</a>&nbsp;|
          <a href="#" v-on:click="onRemove(item)">删除</a>&nbsp;|
        </td>
      </tr>
      </tbody>
    </table>
  </div>

  <div class="col-sm-12">
    注：测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本
  </div>
</template>
<!--itemsearch-tpl-->
<template id="itemsearch-tpl">
  <div class="row">
    <div class="col-sm-12">
      <div class="col-sm-3">
        <button class="btn btn-default" data-toggle="collapse" aria-expanded="false" href="#backToParent"
                v-on:click="backToParent()">返回上一级
        </button>
        <button class="btn btn-default" href="#add" v-on:click="setMode('modeAddNew')">新增</button>
        <button class="btn btn-default" v-on:click="onRemoveSelected($event)">删除选中记录</button>
      </div>
      <div class="col-sm-offset-3 col-sm-3">
        <input id="searchQuery" name="query" type="text" style="float:right" v-model="searchQuery" class="form-control"
               required/>
      </div>

      <div class="col-sm-2">
        <button id='search' class="btn btn-outline btn-block btn-success save" v-on:click="basicsearch($event)"><strong>搜索全部</strong>
        </button>
      </div>
      <div class="col-sm-1 text-left vertical-middle-sm">
        <h5><strong>
          <a role="button" class="control-label" data-toggle="collapse" href="#advancedsearch" aria-expanded="false"
             aria-controls="advancedsearch">高级...</a>
        </strong></h5>
      </div>
    </div>
  </div>
</template>
<!--/itemsearch-tpl-->

<script type="text/javascript" src="../../node_modules/jquery/dist/jquery.js"></script>
<script src="../../lib/jquery/2.1.4/jquery-2.1.4.min.js"></script>
<script src="../../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../../lib/jquery/2.1.4/jquery-2.1.4.min.js"></script>
<script src="../../node_modules/jquery.ui.widget/jquery.ui.widget.js"></script>
<script src="../../lib/vue-router/0.7.13/vue-router.js"></script>
<script src="../../lib/vue-router/0.7.13/vue-router.min.js"></script>
<script src="../../lib/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="../../node_modules/vue/dist/vue.js"></script>
<script src="../../node_modules/vue-resource/dist/vue-resource.js"></script>
<script src="../../node_modules/vue-file-upload-component/vue.file-upload.js"></script>
<script src="../../node_modules/vue-file-upload-component/vue.pretty-bytes.js"></script>
<script src="members.js"></script>
</body>
</html>
